package com.yiboshi.rehrs.util;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @author jack 2025/3/10
 */
@Slf4j
public class AesElephantUtil {

    static String keyString = "41212a6e7ae3f081106ab92fd616c3b5";
    static String ivStr = "b848d08061100668";
    static String sign = "0sRw1sJsHYacCyDBOA03HOEZ6Jymy0Yi";



    public static JSONObject encrypt(String params) {
        try {
            return MyAESUtil.encrypt(keyString, ivStr, sign, params);
        } catch (Exception e) {
            log.error("", e);
            return null;
        }

    }

    public static String decrypt(String txt2) {
        txt2 = txt2.replaceAll("data=", "");
        //String txt = "f6726212134818f87b4fc09830f7382115c0223483969d900c47aa4fc3403e19db0a11195ff974de9a5bcb74e1a0d879ed276db2d5d8c8069222c96e53ba4d64b7f4d10b4148e1cbd8cca009e3ee9fa714a2ebd0cb59c7df3ccf47b4b3956279a9e8590e3a1fa92e4d3231e3062a891970ebea7b324bbc19b517782234812369a401bdf33d1d802669f07d81372fa8f07d969d69d53bc97405b417ab398eadaf67dd1123181233d0be409f67524f966850017fb435f5ced8dccf3d924b18e6e647e18c95634bd42be68e39a06158e34bef8a8a6ac8ca6d5658595e446dd982a6a8fcc746ca2759901463813e9c6f6492c26775cf82a2437f9e4c2196ea38e6b96c1a393b085ecda2d94c78ea0706e1c4d3f4ec9594d89b8f54223be7ba6288f56a8b195b27deb7aff06083c3420ea5552daa40154cc856a992705f9215a908f67c4a971d365347377a02f02fb77d7053ed49823d98205419bef28570547d65ae094d6e318e5480a9ed3f7e44db711124155dd4e997eaa9b77056bc99d1887379b771fe5fbb35cd73e84314ed3e0c6b778f355f86039889de54375fbb8ad096febb28bc05670877f4196c85b558d67d030d9ae452e8ee665fb8c33bc16acf23bc543d881a1b5ee2f1089750fc4fb61f2220c985621d31c6b59d5301140bd9a8c37e394b4aedd27028d8a8007da25eb0bcc4d3d8fc83304782a0ed11e2a819ea9f68a180c85f8305ef445a58417575c11979e47fa08da11723728b808e83352d8e2a472ecd6e497e1abd000ea83a25bd5ca0d7651d5452cd0b3e095ec885f84c3e621d6db4f13c6407c6b7ce44bf7d1301b9dcd7277d41090869462d19a386805362fc8e31e71b66b32d4ee9270330a4a60e1c1fd8e01c2fbb4a2e502c078e6be4ea5e448d5889c26a5f5d10b7597ff11ab5594abb6dc20dad3f6b4831a41b6b43a19d1ca215f6496d8f8c6cec18dac4e358288b1df4283947b9431380f79274b6dfa7d8232c087966cd39d6c4d13c6b4dfc18844f19652871267f90487c6d72274d57fe622458f38fe2e030945e79061b12ddc2172b24f28402831754b69daf3a4eebbb9870c0c46b9de225ad81601381d946e32258d7d2bbf06d9b3f24c9e4a401192599d89d9157dead05ef5f917ec62f571e45c554f7c3dda96141159a74e125e17e4d9ad073564992f851a28177c75dedce4d0eead6b603b74977f6480707685b728cfd3456ca70cd20af719389c9b909b45b796eb2667d48fbc4ff50816a108cffea3026855b72ee3851bac68482d74a943e99bef53def5bec76b2d87a4ee1a62ad0469c4d94e863af5f84a9bf4f86d7345c01c0e4ea33c0cbc0e5dc6364b28a21e802b41d2e074834b4f5fd67dcf96aa9c6790d47173e1edbeca8bfc297f8a1028c3db15a02f196046ac99c408436c5fb570b73dca9c4a7c9c9a59e5f8b174720da3a65029db05b3dc0dec3e57bd33f965816ebac4a71cb87b9fc99eaacf6009f66008c542a60805e61849605b98531c2a3e1fd54409bacea5c03840953f3171331b087d1fba404fd5ee1715e954015032e58cf6058ea4f7687f464abff6aa1dedbaaf2de5ff166259ef737e13f53b121b9c9caa68f853f1ef3116436cb61fc9ea6457203b4ec16af95162ecb406b41e4dec58b3bb8b8c7ffc007df334b2a360cafeae7f6b1e50c87e2acbee31f1f55781dff7e37aec38fea28ff500fa9e6dabeb8640ad4c4666e1ab9a7c3e6adfa2d1599d89c0af78c2fd16d9912c503774b41967e12277009c39954fa39b6a424af2f3f5f910e5e795d59e33758a6b2cfeebb00dd7a4a0599655b5a96656119cbbd876e89ffdb3fbac32b4f99e965bce370bb6a5f47dbd8865b63f8fcea460fc2a4af7ebdafac24484c12af382409b4e17940df6cb102e4caabc05745cee2fa9c9c0adefa776cdd7ad1c6dd078ce5ab23aa6147092ed13e9495620142e92a6cedc33d2cd7ec205d0f7f015ed492dd03fb048a9a496819c03181d4cbe7a16a50fb09dfcf0a8e1ae1c067577e11f173e1bc7e2be82b7cafc39faf69ef11d01b4611fdd7309012cf15b1e5fecd55ae4a4cefe02ec4eb973752a26ec928fe2dd8fd203e6390b80dc891114fff4196c228d221d6c3f55f0b8cb2f3e3a1b691a38753bfc5b5de4209bd60970c9b60d047f8b71a98aef58294f66c161edee6417e7fe140ccfc785ad8026bf78b8620f814dab931682ba7434c5b5a0a9da3f288a1718fa3beeb502adf7c6bc640786e748cdf6c0699410bfb02f57cd77b049b244f23d1addc258f25a6b8777d5729989ab61f1633e21501abf2f6c296a0ea6fcbb8a0d58b7e001b201efb1adbc1c2515b9cae70e4021afe14f1240fdf7fe06a62fc05a32ef55ee0048c464a0112928f648ab3727080a3e180a4675db19683506235732a795268bf6b8b33305930500c4fd62693fb364a3019f8cbb142bb89ac74369caa8fe27fe66729fa1c418b216dd0c04c47e992d2a8f19eca3acf2f8decd65b2ff99599629f04c5a4d26ce247c827a5c9b1f34f433ad677a5a22dc7a8bcf88ec3e8";
        //String txt2 = "7ae64a60ea0e509ac075bba5627727d933e6e1587d66c21417f6f48cfc007aef343ce2b41ddc71919bed903cb1a8e90bd578131d504b29d8a868f5a52504da26e58d8b2d0bcba6584f42c92d2a18b5851bfa0287c9e4a1a6d6c3d0f9b10cf7e7c704f6d0ff128c85cafd7fccd77d84a3a02e58eda948fc8c38c279059b2cab139264c89663ebfbce4928e949ad6369ae3680953e69cd38c40738e30eb4a7b9e876a4e9c8dd05a7f263c6396cb18ac44bca52d7bfcbaa7db6083a3fc13df16c5e918d22be5ffab3ec266edfebbd3851759ba3f062cb381555c1e9379a57b79ad0ff326aa37837ad253b2b173a63a3e04556348bcc24a14ca11b479251bafa8f2022999fe495a933864b803598a933a15ab5dd961420e470893b82746fecbf7b003d58f2b27b7f105e7bcfb723d9911222055948e56882918033fe728ed7cca06f92fa576c8c778cadff83c433d87bc226a001989cc4d896aa0e6ff172ffba3d3fcab17d76258b392060b9f7041f742ffa2f10be66c486997b8e6dda462907c07c412b8e35119c6308dc2ca7a29845bc4e3c6b0fbd1562857e6391a49e5390d5e3e6c4017dae7f769252e4a2cd8e5ea0070889772292e2fdf476e902d828bb0585155f0f10b7f42b6eb3e4a0fc237d25fef5ee3e6d3f4dff28c6f34506cef4f1a3a79119fd7202d63dfc0cf442d496cca60158d48819c3ae85ce860e0e661959d5f6c63fd57890a4cf604ac69ad04c822a4f647bfc0ee312def83395c19167ea3075a47297e3f26eb732ea02eacc0ae7d6f15ad9d9e8ddf39637393594a00db549f0823e3fe36896ae1dc804408b0099c5cfd0736b49ad1104ffb4ac501ceead12eb79fd605aafa1b3c619af2d0421eda1d20e2a72d128d6932ab845e560eed95cbf780680bf0a2e159748f4815e3f860e1a262cbf9f99ab4d27f33d162b3498f7ff3ca436d630c1ca0e35fd4eb871521ea20e6796df0797bcd7a3ee788dc27baeeba5534daa4116e0e6e0353cf90d7d56b0c166da85ece850895905eabc765f698f92fab04b6514083ede655076c4d4cf05871f68ec281380fbabfe113867e439693d9996c4bf5a9b4099b7cd07a2175f0409fcf7ae65390e82900d9fbac28ef764c4ab2f2f8f8aecbadcd94834f87cef50c5902306f5527c997ce129e0563f3e30f4adf7e07f775a8891d9f89db590a86c1e4790633b6533ffbd3a8055e1a09ff761fbdddc7bf190409e379d6c30d026233e6b33d8ff25116a02c93e4029a94a5fb9f24db924bc565d951f0638777a5c84ba0e4e79340d137aeeebc1578fc93d902c112c1f28de3312ea8ac2138a250a399007488345b3a87755554d99efd4dfb58b1d246a20c9af9455a508a2df29c894841ed92356256085bd32a877aa9a8a18bbc83d23264c70f732d1e0b121ede6d6f7ad4f20f2fbd2fe41beadc48b11cbcb4b7b45143fe7513812e8d1737e6536ef96a81c0a4bb3a3f5e52c82973984e6d7dd709d20f4a7baa1ac5f26c361c449c6fc611aea54549bcf851e1c349ba5e31ea0366544b3283849d194f1b85e0a0647d4dd0bc7b8efc02e883dd7920a114856b6fcf58fc5648a96aeed94e1d500c1e187fb3fb505b5b37546ab3c8c23110e7129b86533dd6d67990f1c5ce1e33f611982966fd86351da2fc30b6df85d5b28892071e854ac44cc5bbed7fb83b620bf6523106dd85e31ea25e0a4579304055f04f6086bd2af0284893e60edfd2aefaa5b886c26cc87460d56a593335604dae99fcf8af9dbfdb3992c9556fbaa84e647eb5e3b78672124f9e8fb54806ac2749f07ca6badc601ad9f91a50c0dc678398d98281af154e2d6dcec2c44d23df7c8b87432b051ee8fe35fd481769d17be58c35284d4312eb2d4d7d2f755701cf2e494dbc6229803238153f1e5d56e190e37a227701116d674d84a29d3dfc9869a1eed8b1e4fe597a56443ba623d29b12b13466918bced5c06af64668fb713ed6da2f5242f2a042424c78e9a7923c6cc93b4c80da54953989b2f1baa12b82ab0d97deb7dc05619ba8d579728dd6de90d2d676a5ea77ccf5f7cdb38973e0961472e1f4ce2d03c4be745bf5b508c898e00fbb1ddbf0a781de580a2676e2d4167e0742697a39a5d482921a61d2d95386a01e5dedcaa54fa9c3054f6e3a96b653ed5d17e179f7bdc6c923cf43aa3231f92e817b5e61c84bafc18bf68e5c9820c0af9477b9d2e332703e7780f19ab5cc3f013eb1490a745c85767de133523bcd1fc7228f614a245ae708acd56bca5b1c64406bc8be5b7a41579fbc7bd48bdae7f6b7ca2669beae2ecb3fa026992e72e2666c9eae9dbda393850770688bba0ba617e2cf61201d6b718a13df0493163543f5a116865c1cb2bf45dd8597fa07df182b5f177dd1029093dcf1d3254c6bf8fc26538f191e9626b052f701c972be0967b93835ed1eceaaf1ff683be81d1dadf3613321ab0cdb28d5a9fdfcd9fd8d0a51297eea2b34c9f620a9fc908ad45065f177a6ab7e63d645cb167f58488330d0a88ed622d648a9d7145df140a56836ee584632a78c203";
        //txt2="dd31dc96590d130aeaa17ad53e465830082ec7dd6bb865458ea631e5c76fd8cc25f7b73ae3d59e237399c1ff707597ad930e8f3d0d3f083c38cf22dd0df315b039fd1a60253434cd4411b92add9f32844dd5d69a7b0a59b9909f8243a43b69f0a40bb15377ff8e28bc0ef6f41174053942e60c449b3b817bf197ea26e95b492fd6c5ff062da3aafc38fb0e4058662940761e965b0f7245273f29c32719ea09ae991e0526dd98e47f63d2d49b0f5437623d88f8e18575853608454aa6851af38978d6fa05463560098e1f9076dea4345fa91ac31e962a2655b9e4566b11248cb36f6421b039643e936ea38320a549218515e14cbc654692575e129b6a1c530e4ef9798c45e4c49a0ec7ba4740408d62dae9358046461fa9244e3fe2dc8b47a3ae333fe008854adc9fc593622bb671f6c6da72479beb39a7232abe931a8a9e27aecc7e6d28e2434aae7395acf795c67ea976ac3451ce8288100432ed4794feba10d1a7c58223056e9871e40e2114af816e650e093643576d7428f53a2db3acfb3dffb7ae58138f8badb178f40061c508e570c1e502a73630d2b0c8a4024eb43d680823518c75067261fd0777c4529d6a5b8f3133bd509798e529068b9254c766faa8c8b260cfa5dbce8247f315f1e4563df4277b0313622fa3f18fe042d88ac0e7e418b6bc3b49d4e73722e93659cdcb6b95910fcb3aba4acdb4421b80fc426759009e2f7a7f5322a7caba0b3c77d8010599bd38fa470b5d003d731271fe80e47689844d8bcf5465075a1fa38e43846a77d3e421a4ca642f193ab929124f7dcb177f0ab61aaf84fc6d93316be6350ea8c80afff92eb9bb7a119b83f491c3d9be46aad88e66aafc36bfa108a82d29d3a72b57db79010aef8a0183d726552f1f552dcad1f6c684a342fe3ec4b7538adf555587297dafe2d1df53c43cb4228cf315489881fde2b75d71f2fee5f2d3fa2355ab7e810954853ceeb5fd212c9581ffd026564cc3a2ddd1456b115e769db7b5a54f1d923f520bde1076da03c793b46d9bad28b0109e8f127e4db7ee5e888950f4383a3298563d347076b93fd26ee84cc0ce7d0c134eaf4d5f505ac2bad7ef5f127ea817520d4693882b180a257662ab73f7a9b3af666d4bf15042bf52ffdb5d7f1c9c6d2d132d11315d4b98eb27b0829565db5e216f67d052e4ee85dfeec13cae2cc221b54618c92f220ee965da1e23372bf533af9a79b3708af17507e802e4e018bfd075f4dda35a2ca5b231fa3e9c50ca84ef5ec62e3615d763d796745f25b6eabb9662f903a7585015e88d50e18b3798c0a59d6e201f6748669f02881801a307c652ecba2b2ae1f325bceb25984bda8a6eee82fcbc59b905cc0bc0b09c5407b0f553a7907abc4b5d5a50cd9f103bfdc859d5dde33ee6cdd32f3e8d606d3502abd5be4c4bdd67231d6faa31ace9832860de585aa261f208bbc5605341f27ff264233d01beb8f28d8a50a795db4a5f7c2c2c81457053bbcc7b0070a1b89d2df8290a9ceffd5f1dc872a3b0446686ba8cc1d7df0a21a6362b382810f144cb9d47959b539b64e6313de687e0259da28302f5deb417e38a8850257e27b6114f5d420b1e02bd73f2c5192d0e93aa19d3d904c391b30c33f04cab68c873a47f0666ad62201d43a9bb4d159303a9a5a31e859a4072daaccd48ed54870bee916adf2e4804bdb5a03486d71cd7bdda2d66c65a6e36b96a9dfa6f616b1f048373c7faefc78c3faab6ee2fca654859f513934046358b1355e27b946130cb51ce53853321d37a5c5941aa99f46e7faf24a44cea5baf40c465c9ce7ae0826bd1f13499fb1b4f425cb2f4c60aa9680154c4ba4b73e1f43568f5d8bacb01fd53c829af6acfd7efdf1aaaf028462293e507aa3c7452d9972b4a13e4b02fd755e63fac368940648218deab0fa2c7db3f6085601c0a4f4f8ef403e1f01c373e6b4cca195a116590893ca1043e9a50398c642814fe07b2beeb5abe8e2112ca82725b873f3f4278f64f4f7dbf10d46e2100e8fe213ba35344efe28e55b5509daa32041593402d70f6197e41059485194559859402a591d0fdeb50e7b055ef5518f4f98b070bfd841d9d000680f385d3d27f9112c93ae608e6fdf872b428440aff184b92d0083015cf07c88164cf3a1c0d5cf9493239eab196370eb083d558d7fcc5330f2b8e2b911cdeae25ca34acb06df1319756a7638d8fc95d08b4c625648153f755c0f92aff29cd3d5bd8b8a0e72e0b93bafe0531fdc11c4b5f1915bcaa5d2b940fe699193df8e08227c7539b68323d5c3887fa950b9c113eea17e6389b3515f6058fa92d0ccdd243464d5abcd7d5b4e7800398e66ba928c320ddf3c850e43360f240c9a6e8ea15bfefdcf3c292d6b1fba1a488f45d0a21a3db43470c9c8b37a989d2d74e5375fc42a42bc4f191734f83415eec7b0a6d54456f34f386c454c6d0fb522acb82809f1b58bc5b91dbc361e7b17348c5e25819de8c39425cec59e64e86dc60ff51434b8de8752587362bc5c5a4e672e11b55b258df9ae7f892f1a9ad2ddb2b75c82c811d1ff1c72413c725faa2c68a22bd2ee35378823eaf439544a4156f8c42dc71f8495c743703ef2073ea85a63eed99eeb6a1dc4842585c1653894dbb382a3dc9d8242086714dec8e108d65bdcf60bfa63a34c12673bba0f55df44a2a5023e639590f602fcec675bfd33ef58af8a69a676f5269a8a55721627b01b6a3369572ea6a2ce3940b4f786611e3c43b61e1a95ad7a5283cbdc65f9d1432faced7e872836e5cb1e13c0ef1ed800bff95448a2d8db6485af7c464dd08e5281a8948cf059452da756841b0f0971280b118f6469b7c3868f105e770d519774e39c5bdfa44ceb4be";
        //txt2=txt2.substring(5);
        String s = MyAESUtil.decryptAES(txt2, keyString.getBytes(), ivStr
        );
        return s;
    }

    //轨迹查询入参
    //token=08d5210be5c810d1616614a73948618c&type=searchMailPost_new&code=8161525244908&pda_user_token=&imei=869296041015581&dev=&time=1753339126468
    public static void main(String[] args) {
        String decrypt = decrypt("data=d35bcef701df11c2dfa8c6020981b9c7294f4b9db974234cf9c9329d132763fd7dd9000529d29f24f4f136ca16c480a167cd102f4fbf673faa32a07c99a581326d17d588d9e0eb1881824a1537c33ff573981899cde6667988ee526f598f3fead5d84f4d4a268b7643804a659e3588d12e4507c55583c75f44266d597fa17236a8cb1a6c859b8700b08181d8915609dd28d77e0bbd79a14d1d024e17619105e6");
        System.out.println(decrypt);



    }
}
